-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Enable RestClientAutoConfiguration in reactive web applications when virtual threads are enabled #44952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
NotReactiveWebApplicationOrVirtualThreadsEnabledCondition
for RestClientAutoConfiguration
See spring-projects#44912 Signed-off-by: Dmitry Sulman <[email protected]>
Refine `RestClientAutoConfiguration` conditional so that it applies in reactive web applications if virtual threads are active and a task executor is configured. See gh-44952 Signed-off-by: Dmitry Sulman <[email protected]>
Thanks @dmitrysulman! I've merged this with one small amendment to try and also check that there's an |
I'm curious as to why only when Virtual Threads are enabled. WebFlux can be configured with a |
@blake-bauman We I looked at the PR I couldn't see an obvious way to tell if the |
Actually, thinking about things some more, I'm not sure we can use a hook like that since we need to make our condition decision before the |
I think my main question is, what is the need to detect? Even if an app has Virtual Threads enabled, I don't believe the execution is offloaded to a Virtual Thread if the Controller method return type is (For reference, this is for apps which, for one reason or another, can't yet update to Java 21 and therefore can't enable Virtual Threads, but have used the ThreadPoolTaskExecutor for the BlockingExecutionConfigurer) |
@blake-bauman I'll need to discuss this with the team again to see and with some folks that have more knowledge of the reactive stack. I've flagged this one for our next meeting. |
For now, we've just copy/pasted the entire |
This PR introduces
NotReactiveWebApplicationOrVirtualThreadsEnabledCondition
for use inRestClientAutoConfiguration
.Closes #44912